﻿
var newWin
function PopupWindowCenter(URL, title, w, h) {
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    var newWin = window.open(URL, title, 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
function PupupCenter(id, masv, type) {
    var w = 600;
    var h = 600;
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);
    if (type != "") {
        newWin = window.open('/diemthanhphan.aspx?id=' + id, "T", 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
    }
    else {
        newWin = window.open('/admin/diemthanhphan.aspx?masv=' + masv + '&id=' + id, "T", 'toolbar=no, location=no,directories=no, status=no, menubar=no, scrollbars=no, resizable=no,copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
    }
    newWin.focus();
}

$(document).ready(function () {
    $(window).focus(function () {
        if (window.focus) {
            if (newWin != null) {
                newWin.close();
            }
        }
    });

    $("#progress_div").css("position", "fixed");
    $("#progress_div").css("top", ($(window).height() - $("#progress_div").height()) / 2 + "px");
    $("#progress_div").css("left", ($(window).width() - $("#progress_div").width()) / 2 + "px");
});




